#!/bin/bash

PROJECT="persist"
PIDFILE="/tmp/$PROJECT.pid"
SOCKET="127.0.0.1:34567"
LOG="/home/timest/uwsgi_"$PROJECT".log"
FILE="/home/timest/persist/src/app.py"
MODULE="$PROJECT.wsgi"
CHDIR="/home/timest/persist/src"
kill -9 `ps aux | grep $PROJECT | grep -v 'grep' |awk '{print $2}'`

sleep 2
nohup uwsgi --socket $SOCKET --chdir $CHDIR --wsgi-file $FILE --callable app --processes 4 --threads 2  >> $LOG &